#!/usr/bin/env python
import time,threading,math

boredtime = time.time()

interbored = 60*60*3;
patience = interbored;
cbo = 0


class boredthread ( threading.Thread ):
	def __init__(self,daft):
		threading.Thread.__init__(self)
		self.daft = daft
	def run ( self ):
		global boredtime, interbored,cbo
		while True:
			time.sleep(1)
			if cbo != int(time.time() - boredtime):
				cbo = int(time.time() - boredtime)
				if cbo%60 == 0:
					print "boredom has reached "+str(cbo)
			if time.time() - boredtime > interbored:
				interbored = interbored * 2
				self.daft.boom("DAFTBORED","daft","boredom")
			
def howbored():
	global interbored,boretime,cbo
	boredwords = ["not","not really","a bit","kinda","pretty","very","incredibly"]
	return str(len(boredwords)/interbored)+" out of "+str(len(boredwords))

def setbored(period):
	global interbored, patience
	old = interbored
	interbored = int(period)
	patience = interbored
	return str(old)+" to "+str(interbored)

def tick():
	pass

def start(daft):
	t = boredthread(daft)
	t.start()
	start
def say(daft,r,who,w):
	global boredtime, patience
	boredtime +=(time.time() - boredtime)/2
	interbored = patience
def stop():
	pass
